/*
 * easysmtp - A simple C lib in Linux to help you send mails in an easy way
 * Copyright (C) 2012-2013, easysmtp developers and contributors
 *
 * easysmtp is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * easysmtp is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with easysmtp; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#include "error.h"

int serrno = 0;

//不同的错误提醒
char serror_detail[][ANSWER_MAXLEN+1] = 
	{"Success",
		"Failed to set the information",
		"Service not available, closing transmission channel",
		"Requested mail action not taken: mailbox unavailable",
		"Requested action aborted: local error in processing",
		"Requested action not taken: insufficient system storage",
		"Syntax error, command unrecognized",
		"Syntax error in parameters or arguments",
		"Command not implemented",
		"Bad sequence of commands",
		"Command parameter not implemented",
		"Requested action not taken: mailbox unavailable",
		"User not local; please try <forward-path>",
		"Requested mail action aborted: "
		"exceeded storage allocation",
		"Requested action not taken: mailbox name not allowed",
		"Transaction failed",
		"Error: authentication failed",
		"Error!"};

//获取系统错误的出错提醒
void 
psys_error() 
{
	perror("Error");		
}

//获取smtp错误的出错提醒
void 
psmtp_error() 
{
	fprintf(stderr, "%s\n", serror_detail[serrno]);	
}

void 
pssl_error() 
{
	ERR_print_errors_fp(stderr);	
}
